package BehaviorModel.mediatorModel;

/**
 * 功能描述: 中介者模式 - 测试类
 * 2024/02/20
 * <p>
 * ZhangYi
 */
public class MediatorClientTest {

    public static  void main(String[] args){
        // 创建中介者对象
        Mediator mediator = new ConcrateMediator();

        // 创建同事对象 并且 注册到中介者对象中
        // 1. 电视
        TVColleague tvColleague = new TVColleague(mediator,
                                         "电视");

        // 2. 窗帘
        CurtainsColleague curtainsColleague = new CurtainsColleague(mediator,
                                                   "窗帘");

        // 3. 冰箱
        RefrigeratorColleague refrigeratorColleague = new RefrigeratorColleague(mediator,
                                                         "冰箱");

        tvColleague.startTV();
    }
}
